# 读取excel文件数据
import openpyxl
import os

BASEDIR = os.path.dirname(os.path.dirname(__file__))

print('BASEDIR:' + BASEDIR)


def read_excel():
    # 读取data文件
    workbook = openpyxl.load_workbook(BASEDIR + "/data/data.xlsx")
    # 读取data文件的sheet
    sheet = workbook["01"]
    alllist = []
    for row in range(2, sheet.max_row + 1):
        templist = []
        for col in range(2, sheet.max_column + 1):
            templist.append(sheet.cell(row, col).value)
        alllist.append(templist)
    return alllist


print(read_excel())
